<template>
	<view class="u-p-l-20 u-p-r-20" style="line-height:60rpx;">
			<mp-html :content="content" :tag-style="tagStyle" selectable lazy-load>加载中...</mp-html>
	</view>
</template>
<script>
export default {
	data() {
		return {
			tagStyle: {
				img:'vertical-align: bottom; display:block'
			 },
			content : ''
		}
	},
	onLoad(options){
		console.log(options)
		this.getContent(options.key)
	},
	methods: {
		async getContent(key) {
			let that = this
			let res = await vk.callFunction({
				url: 'client/config/pub/getList',
				title: '请求中...',
				data: {
					"pageIndex": 1,
					"pageSize": 1,
					"formData": {
						"key":key
					},
					"columns": [{
						key: "key",
						title: "编号",
						type: "text",
						mode: "="
					}]
				}
			})	
			if (res.code == 0 && res.total > 0) {
				that.content = res.rows[0].value
			} else {
				vk.toast("未获取到内容")
			}
		},
	}
}
</script>
<style>
</style>